﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OpenWaves.ActivityFeed.Web.Tests.Samples
{
    public partial class SampleTopicsFilterExternal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if ( !IsPostBack)
            {
                var users = FakeUserProfileProvider.Users.Select(u => new { Id = u.Key, DisplayName = u.Value.Name, Topic =Topic.FromUserId(u.Key).ToString() }).ToList();

                this.lstMain.DataSource = users;
                foreach (var user in users)
                {
                    this.afMain.TopicsFilter.Add(Topic.FromUserId(user.Id));
                }

                this.DataBind();
            }
        }
    }
}